home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
M-More Monthly Disks
/
(c)m7.d64
/
tape cataloger.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
2KB
|
46 lines
10 FORI=707TO725:READA:POKEI,A:CK=CK+A:NEXT:IFCK<>2384THENPRINT"DATA ERROR"
11 IFCK<>2384THENSTOP
12 BC$=CHR$(14):SYS65517:IFPEEK(781)=40THENTYPE=64:GOTO14
13 POKE36879,8:B$="[147]":M1=36876:POKE36876+2,15:GOTO20
14 SO=54272:FORT=SOTOSO+24:POKET,0:NEXT
15 POKE53280,0:POKE53281,0:POKESO+24,15:POKESO+5,17:B$="[147]"
16 POKESO+6,250:POKESO,100:POKESO+1,160
20 DIM LOC(50),N$(50),BYTES(50):I=1:J$=CHR$(16):CR$=CHR$(13)
25 M$="TAPE CATALOG"+CR$
30 LC$=CHR$(15):PRINTB$"[159]****TAPE DIRECTORY****[146]"
40 INPUT"HARDCOPY (Y/N)";H$:IF H$="_" THENEND
50 IFH$="Y"THENINPUT"[158]PRINTER ON[146]";H$:H=1:GOSUB900:OPEN4,4,7
55 S$="ONE":PRINT"TAPE NAME:";:INPUTCN$:INPUT"SIDE 1 OR 2";S
60 INPUT"DATE:";DA$:IFS=2THENS$="TWO"
65 CN$=CN$+"/"+S$
70 PRINT"REWIND TAPE.[146]":PRINT"SET COUNTER.000[146]":PRINT"PRESS F7 KEY.[146][158]"
80 GETA$:IFA$<>CHR$(136)THEN80
100 GOSUB900:CLOSE1:IFST=-128THEN700
110 SYS 707:IFST=-128THEN700
120 B1=PEEK(829)+256*PEEK(830):B2=PEEK(831)+256*PEEK(832):BYTES(I)=B2-B1
130 IFI=1THENM$=M$+CN$+CR$+DA$:PRINT"[147]"M$
140 IFI=1THENIFH=1THENPRINT#4,BC$;M$;LC$;CR$
200 L$="":GOSUB900:GOSUB900:INPUT"[156]COUNTER#[146]:";L$:IFL$=""THEN200
210 L=VAL(L$)
220 IFI=1THENLOC(2)=L:LOC(1)=0:GOTO300
230 LOC(I+1)=L
300 FORX=0TO15:N$(I)=N$(I)+CHR$(PEEK(833+X)):NEXT
350 PRINT""LOC(I);TAB(4);""N$(I)""BYTES(I)"[157] BYTES.":GOSUB900
360 IFH=1THENGOSUB920
370 IFL$="_"THENCLOSE1:GOTO700
400 I=I+1:GOTO100
700 PRINT"I/O STATUS="ST:GOSUB900:CLOSE1:LM=I:IFN$(LM)=""THENLM=I-1
800 IFH=1THENPRINT#4:CLOSE4:H=0
810 D$="":INPUT"DISPLAY Y/N/H";D$:IFD$="N"THENEND
820 IFD$="H"THEN CLOSE4:OPEN4,4:PRINT#4,BC$;M$;LC$:H=1
830 PRINT"[147]"CN$:FOR I=1TOLM:PRINT"[158]"LOC(I);TAB(4)""N$(I)""BYTES(I)
840 IF D$="H"THENGOSUB920
845 IFI/10=INT(I/10)THENINPUT"MORE Y/N";M$:IFM$="N"THEN800
850 IFI/10=INT(I/10)THENINPUT"MORE Y/N";M$:IFM$="N"THEN810
860 NEXT:GOTO800
900 IFTYPE=64THEN910
905 POKEM1,232:FORS=1TO50:NEXT:POKEM1,0:RETURN
910 POKESO+4,17:POKESO+4,16:RETURN
920 PRINT#4,LOC(I);J$+"06";N$(I);J$+"24";BYTES(I)J$"29"+"BYTES.":RETURN
1000 DATA 169,1,170,160,0,32,186,255,169,0,32,189,255,169,1,32,213,255,96